<?php

include( "./admin/include/func.php");

$db = new db();
if ( ! $db->connect()) exit( mysql_error());

$g_id = $_GET['id'];

$db->sql = "SELECT id,nev,email,targy,szoveg,ar,telefon,weblap,kep,telepules,feladas,lejarat,
			(SELECT r.nev  FROM rovat r WHERE r.id=rovat) as rovat,
			(SELECT r.slug FROM rovat r WHERE r.id=rovat) as rovat_slug,
			(SELECT r.nev  FROM regio r WHERE r.id=regio) as regio  
			FROM hirdetes 
			WHERE id='$g_id' AND aktiv=1";				
$db->query();

?>
<html lang="hu" dir="ltr" xml:lang="hu" xmlns="http://www.w3.org/1999/xhtml">

<head>
	
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta http-equiv="content-language" content="hu">
	<meta http-equiv="charset" content="utf-8">
	<link rel='stylesheet' href='css/print.css' type='text/css' media='screen' />
</head>
<body>
<table cellpadding='5px' cellspacing='1px'>
	<tr>
		<td>		
			<a href='#' onclick='window.print();'>
				<img src='./images1/print.gif' />
			</a>		
		</td>
		<td align='center'>
			<?php print $site; ?>
		</td>
	</tr>
<?php

$row = mysql_fetch_assoc( $db->rs);

$mezok = array (
	array ('id','Sorszám'),
	array ('nev','Feladó'),
	array ('email','Email'),
	array ('targy','Tárgy'),
	array ('szoveg','Szöveg'),
	array ('ar','Ár'),
	array ('telefon','Telefon'),
	array ('weblap','Weblap'),
	array ('kep','Kép'),
	array ('telepules','Település'),
	array ('feladas','Feladás'),
	array ('lejarat','Lejárat'),
	array ('rovat','Rovat'),
	array ('regio','Régió')
);

if ($row['kep'] != '') {
	GLOBAL $upload_path;
	$thumb = $upload_path . '/' . str_replace('-','/',$row['feladas']) . '/thumb/thumb_' . $row['kep'];
	if (! file_exists ($thumb)) {
		$thumb = 'http://hirdetek.net/thumbs1/thumb_'.$row['kep'];
	}
?>
	<tr>
		<td >
			Kép
		</td>
		<td >
			<img src='<?php print $thumb; ?>' />
		</td>
	</tr>
<?php
}  
foreach ($mezok as $mezo) {
	if ($row[$mezo[0]] != '') {
?>
	<tr>
		<td ><?php print $mezo[1]; ?></td>
		<td width='500px' ><?php print $row[$mezo[0]]; ?></td>
	</tr>
<?php
	}
}

?>
	<tr>
		<td colspan=2 align='center'>
			<?php print $site; ?>
		</td>
	</tr>
</table>
</body>
</html>
